package org.example.utils;

import com.alibaba.fastjson.JSON;
import org.example.ws.pojo.ResultMessage;

/**
 * ClassName: MessageUtils
 * Description:
 *
 * @Author Kotaro
 * @Create 2025/1/8 10:52
 * @Version 1.0
 */
public class MessageUtils {
    public static String getMessage(boolean isSystemMessage , String fromName , Object message){
        ResultMessage resultMessage = new ResultMessage();
        resultMessage.setSystem(isSystemMessage);
        resultMessage.setMessage(message);

        if(fromName != null){
            resultMessage.setFromName(fromName);
        }
        return JSON.toJSONString(resultMessage);

    }
}
